﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Sunny.UI;

namespace AutoShuntingSchedule.UI.Forms
{
    public partial class RouteForm : UIPage
    {
        public RouteForm()
        {
            InitializeComponent();
        }

        private void SysDataForm_Load(object sender, EventArgs e)
        {
            if (DesignMode)
            {
                return;
            }

            List<ToolStripButton> Model_buttons_list = new List<ToolStripButton>();
            var cntButton = 9;
            for (int i = 0; i < cntButton; i++)
            {
                var toolStripButton = new ToolStripButton();
                toolStripButton.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                //toolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("tb_Model1.Image")));
                toolStripButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
                toolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                toolStripButton.Name = $"tb_Model{i + 1}";
                toolStripButton.Size = new System.Drawing.Size(60, 54);
                toolStripButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
                toolStripButton.Click += new System.EventHandler(this.tb_Model_Click);
                toolStripButton.Text = $"模板{i + 1}";
                this.toolStrip1.Items.Add(toolStripButton);
                Model_buttons_list.Add(toolStripButton);
                if (i >= cntButton - 1) continue;
                this.toolStrip1.Items.Add(new ToolStripSeparator());
            }

            //foreach (var item in KxSetMa.getInstance().Model_RouteDic.Values)
            //{
            //    foreach (var tb in Model_buttons_list)
            //    {
            //        if (tb.Name == item.KeyName)
            //        {
            //            tb.Text = item.HeadStr;
            //        }
            //    }
            //}
        }

        private void tb_Model_Click(object sender, EventArgs e)
        {

        }
    }
}
